package com.slz3.business.module.memberManagement.memPoint.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memPoint.domain.MemPoint;
import com.slz3.business.module.memberManagement.memPoint.domain.MemPointCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class MemPointResController extends MemPointResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, MemPoint memPoint) {
        if (MemPointResUnsafeValid.add(req, memPoint)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$MemPointUpdateLock(req, memPoint);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, MemPointCondition memPointCondition) {
        if (MemPointResUnsafeValid.delete(req, memPointCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$MemPointUpdateLock(req, memPointCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, MemPoint memPoint) {
        if (MemPointResUnsafeValid.modify(req, memPoint)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$MemPointUpdateLock(req, memPoint);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (MemPointResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return memPointResAtomic.info_$MemPointUpdateLock(req);
        if (MemPointResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$MemPointUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (MemPointResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, MemPointCondition memPointCondition) {
        //
        if (MemPointResUnsafeValid.auditSubmit(req, memPointCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$MemPointUpdateLock(req, memPointCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, MemPointCondition memPointCondition) {
        if (MemPointResUnsafeValid.audit(req, memPointCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$MemPointUpdateLock(req, memPointCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, MemPointCondition memPointCondition) {
        if (MemPointResUnsafeValid.auditReject(req, memPointCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$MemPointUpdateLock(req, memPointCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, MemPointCondition memPointCondition) {
        if (MemPointResUnsafeValid.usingEnable(req, memPointCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$MemPointUpdateLock(req, memPointCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, MemPointCondition memPointCondition) {
        if (MemPointResUnsafeValid.usingDisable(req, memPointCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$MemPointUpdateLock(req, memPointCondition);
        }
    }

}
